Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for localAddress option of net.Socket #141

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

peschuster
Copy link
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Feature

  • What is the current behavior? (You can also link to an open issue here)
    It is not possible to bind the client to a local address.
    When multiple CasparCG clients run on the same host only one of them can receive OSC data from the CasparCG server, because CasparCG always sees the same sender address for the AMCP connection.

  • What is the new behavior (if this is a feature change)?
    This feature allows to specify a local address for the casparcg-connection.
    Therefore a host with multiple addresses in the same subnet can run multiple CasparCG clients, bound to distinct IP adresses and therefore all receiving OSC data from the CasparCG server.

  • Other information
    Tested with official CasparCG release "2018-12-29 - Version 2.2.0 Stable" and used in production at two multi day events during the last months with CasparCG as video playout server and generator for lower thirds with the following clients: https://github.com/peschuster/casparcg-hyperdeck

@@ -35,6 +35,7 @@ export class CasparCGSocket extends EventEmitter implements ICasparCGSocket {
private _client: net.Socket
private _host: string
private _port: number
private _localAddress: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typings here should be string | undefined I think, since that's how you define it in the public interface

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied the behavior/style of the host field, but I think your right: localAddress should probably not have a default value from the IPv4 address space. This might break attempts to connect to an IPv6 host. I will have a look at this but need to do some more testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it and did some tests with the new default value undefined.

@peschuster peschuster changed the base branch from master to develop September 2, 2019 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants